package ff;

import java.awt.event.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.text.SimpleDateFormat;
import javax.swing.*;

import dao.Dao;

public class Ff_Add implements ActionListener{
	private String name,sex,room,bed,man,money,mz,family,tellphone,IDcard;
	private JButton btn_add;
	private Object data;
	public Ff_Add(String name,String sex,String mz,String IDcard,String family,String tellphone,String room,String bed,String man,String money,JButton btn_add){
		this.name=name;
		this.sex=sex;
		this.mz=mz;
		this.IDcard=IDcard;
		this.family=family;
		this.tellphone=tellphone;
		this.room=room;
		this.bed=bed;
		this.man=man;
		this.money=money;
		this.btn_add=btn_add;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==btn_add){
			Dao d=new Dao();
			SimpleDateFormat df= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			data=df.format(new Date());
			d.old_Add(name,sex,mz,IDcard,family,tellphone,room,bed,man,money,data);
		}
	}

}
